package nancal.mp.db.mongo.entity.sys


import nancal.mp.db.mongo.entity.dev.SshServerConfig
import nbcp.base.db.annotation.Cn
import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.model.BaseMarkEntity
import org.springframework.data.mongodb.core.mapping.Document


open class ImageRegistryConfig() {
    var isHttps: Boolean = true
    var host: String = ""
    var userName: String = ""
    var password: String = ""
    var keepMaxCount: Int = 10
}

class K8sServerConfig() {
    var apiServerHost: String = ""
    var apiToken: String = ""
}


@Document
@DbEntityGroup("sys")
@Cn("K8s使用脚本同步配置")
open class K8sSyncSetting : BaseMarkEntity() {
    var name: String = ""

    var testSsh: SshServerConfig = SshServerConfig()
    var prodK8s: K8sServerConfig = K8sServerConfig()
    var prodRegistry: ImageRegistryConfig = ImageRegistryConfig()

    var isActive: Boolean = false

    /**
     * 测试服务器推送脚本
     */
    var testPushScript: String = ""

    /**
     * 服务器端应用脚本
     */
    var prodDeployScript: String = ""
}